<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gmime-charset: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="core.html" title="Part III. GMime Core Reference">
<link rel="prev" href="gmime-gmime.html" title="gmime">
<link rel="next" href="gmime-gmime-iconv.html" title="gmime-iconv">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gmime-gmime-charset.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gmime-gmime.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gmime-gmime-iconv.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gmime-gmime-charset"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gmime-gmime-charset.top_of_page"></a>gmime-charset</span></h2>
<p>gmime-charset — Charset helper functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gmime-gmime-charset.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-map-init" title="g_mime_charset_map_init ()">g_mime_charset_map_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-map-shutdown" title="g_mime_charset_map_shutdown ()">g_mime_charset_map_shutdown</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-locale-charset" title="g_mime_locale_charset ()">g_mime_locale_charset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-locale-language" title="g_mime_locale_language ()">g_mime_locale_language</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-language" title="g_mime_charset_language ()">g_mime_charset_language</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-canon-name" title="g_mime_charset_canon_name ()">g_mime_charset_canon_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-iconv-name" title="g_mime_charset_iconv_name ()">g_mime_charset_iconv_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-name" title="g_mime_charset_name ()">g_mime_charset_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-locale-name" title="g_mime_charset_locale_name ()">g_mime_charset_locale_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-iso-to-windows" title="g_mime_charset_iso_to_windows ()">g_mime_charset_iso_to_windows</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-init" title="g_mime_charset_init ()">g_mime_charset_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-step" title="g_mime_charset_step ()">g_mime_charset_step</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-best-name" title="g_mime_charset_best_name ()">g_mime_charset_best_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-best" title="g_mime_charset_best ()">g_mime_charset_best</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-can-encode" title="g_mime_charset_can_encode ()">g_mime_charset_can_encode</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gmime-gmime-charset.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gmime-gmime-charset.html#GMimeCharset" title="struct GMimeCharset">GMimeCharset</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gmime-gmime-charset.description"></a><h2>Description</h2>
<p>Charset utility functions.</p>
</div>
<div class="refsect1">
<a name="gmime-gmime-charset.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-mime-charset-map-init"></a><h3>g_mime_charset_map_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_charset_map_init (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Initializes character set maps.</p>
<p>Note: <a class="link" href="gmime-gmime.html#g-mime-init" title="g_mime_init ()"><code class="function">g_mime_init()</code></a> calls this routine for you.</p>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-map-shutdown"></a><h3>g_mime_charset_map_shutdown ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_charset_map_shutdown (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Frees internal lookup tables created in <a class="link" href="gmime-gmime-charset.html#g-mime-charset-map-init" title="g_mime_charset_map_init ()"><code class="function">g_mime_charset_map_init()</code></a>.</p>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-locale-charset"></a><h3>g_mime_locale_charset ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_locale_charset (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Gets the user's locale charset (or iso-8859-1 by default).</p>
<div class="refsect3">
<a name="g-mime-locale-charset.returns"></a><h4>Returns</h4>
<p> the user's locale charset (or iso-8859-1 by default).</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-locale-language"></a><h3>g_mime_locale_language ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_locale_language (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Gets the user's locale language code (or <code class="literal">NULL</code> by default).</p>
<div class="refsect3">
<a name="g-mime-locale-language.returns"></a><h4>Returns</h4>
<p>the user's locale language code (or <code class="literal">NULL</code> by default). </p>
<p><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-language"></a><h3>g_mime_charset_language ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_language (<em class="parameter"><code>const <span class="type">char</span> *charset</code></em>);</pre>
<p>Attempts to find a specific language code that is specific to
<em class="parameter"><code>charset</code></em>
. Currently only handles CJK and Russian/Ukranian
charset-&gt;lang mapping. Everything else will return <code class="literal">NULL</code>.</p>
<div class="refsect3">
<a name="g-mime-charset-language.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset name</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-language.returns"></a><h4>Returns</h4>
<p>a language code that is specific to <em class="parameter"><code>charset</code></em>
,
or <code class="literal">NULL</code> on fail. </p>
<p><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-canon-name"></a><h3>g_mime_charset_canon_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_canon_name (<em class="parameter"><code>const <span class="type">char</span> *charset</code></em>);</pre>
<p>Attempts to find a canonical charset name for <em class="parameter"><code>charset</code></em>
.</p>
<p>Note: Will normally return the same value as
<a class="link" href="gmime-gmime-charset.html#g-mime-charset-iconv-name" title="g_mime_charset_iconv_name ()"><code class="function">g_mime_charset_iconv_name()</code></a> unless the system iconv does not use
the canonical ISO charset names (such as using ISO8859-1 rather
than the canonical form ISO-8859-1).</p>
<div class="refsect3">
<a name="g-mime-charset-canon-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset name</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-canon-name.returns"></a><h4>Returns</h4>
<p> a canonical charset name for <em class="parameter"><code>charset</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-iconv-name"></a><h3>g_mime_charset_iconv_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_iconv_name (<em class="parameter"><code>const <span class="type">char</span> *charset</code></em>);</pre>
<p>Attempts to find an iconv-friendly charset name for <em class="parameter"><code>charset</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-charset-iconv-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset name</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-iconv-name.returns"></a><h4>Returns</h4>
<p> an iconv-friendly charset name for <em class="parameter"><code>charset</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-name"></a><h3>g_mime_charset_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_name (<em class="parameter"><code>const <span class="type">char</span> *charset</code></em>);</pre>
<div class="warning"><p><code class="literal">g_mime_charset_name</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Attempts to find an iconv-friendly charset name for <em class="parameter"><code>charset</code></em>
.</p>
<p>Note: This function is deprecated. Use <a class="link" href="gmime-gmime-charset.html#g-mime-charset-iconv-name" title="g_mime_charset_iconv_name ()"><code class="function">g_mime_charset_iconv_name()</code></a>
instead.</p>
<div class="refsect3">
<a name="g-mime-charset-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset name</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-name.returns"></a><h4>Returns</h4>
<p> an iconv-friendly charset name for <em class="parameter"><code>charset</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-locale-name"></a><h3>g_mime_charset_locale_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_locale_name (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning"><p><code class="literal">g_mime_charset_locale_name</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Gets the user's locale charset (or iso-8859-1 by default).</p>
<p>Note: This function is deprecated. Use <a class="link" href="gmime-gmime-charset.html#g-mime-locale-charset" title="g_mime_locale_charset ()"><code class="function">g_mime_locale_charset()</code></a>
instead.</p>
<div class="refsect3">
<a name="g-mime-charset-locale-name.returns"></a><h4>Returns</h4>
<p> the user's locale charset (or iso-8859-1 by default).</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-iso-to-windows"></a><h3>g_mime_charset_iso_to_windows ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_iso_to_windows (<em class="parameter"><code>const <span class="type">char</span> *isocharset</code></em>);</pre>
<p>Maps the ISO-8859-# charset to the equivalent Windows-CP125#
charset.</p>
<div class="refsect3">
<a name="g-mime-charset-iso-to-windows.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>isocharset</p></td>
<td class="parameter_description"><p>ISO-8859-# charset</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-iso-to-windows.returns"></a><h4>Returns</h4>
<p> equivalent Windows charset.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-init"></a><h3>g_mime_charset_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_charset_init (<em class="parameter"><code><a class="link" href="gmime-gmime-charset.html#GMimeCharset" title="struct GMimeCharset"><span class="type">GMimeCharset</span></a> *charset</code></em>);</pre>
<p>Initializes a charset mask structure.</p>
<div class="refsect3">
<a name="g-mime-charset-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset mask</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-step"></a><h3>g_mime_charset_step ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_charset_step (<em class="parameter"><code><a class="link" href="gmime-gmime-charset.html#GMimeCharset" title="struct GMimeCharset"><span class="type">GMimeCharset</span></a> *charset</code></em>,
                     <em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
                     <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>);</pre>
<p>Steps through the input buffer 1 unicode character (glyph) at a
time (ie, not necessarily 1 byte at a time). Bitwise 'and' our
<em class="parameter"><code>charset-&gt;mask</code></em>
 with the mask for each glyph. This has the effect of
limiting what charsets our <em class="parameter"><code>charset-&gt;mask</code></em>
 can match.</p>
<div class="refsect3">
<a name="g-mime-charset-step.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset structure</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>input text buffer (must be in UTF-8)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-best-name"></a><h3>g_mime_charset_best_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_best_name (<em class="parameter"><code><a class="link" href="gmime-gmime-charset.html#GMimeCharset" title="struct GMimeCharset"><span class="type">GMimeCharset</span></a> *charset</code></em>);</pre>
<p>Gets the best charset name based on the charset mask <em class="parameter"><code>charset</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-charset-best-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>charset mask</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-best-name.returns"></a><h4>Returns</h4>
<p>the charset name that best represents the charset
mask <em class="parameter"><code>charset</code></em>
or <code class="literal">NULL</code> for us-ascii. </p>
<p><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-best"></a><h3>g_mime_charset_best ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_charset_best (<em class="parameter"><code>const <span class="type">char</span> *inbuf</code></em>,
                     <em class="parameter"><code><span class="type">size_t</span> inlen</code></em>);</pre>
<p>Computes the best charset to use to encode this text buffer.</p>
<div class="refsect3">
<a name="g-mime-charset-best.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>inbuf</p></td>
<td class="parameter_description"><p>a UTF-8 text buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>inlen</p></td>
<td class="parameter_description"><p>input buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-best.returns"></a><h4>Returns</h4>
<p>the charset name best suited for the input text
or <code class="literal">NULL</code> if it is ascii-safe. </p>
<p><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-charset-can-encode"></a><h3>g_mime_charset_can_encode ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
g_mime_charset_can_encode (<em class="parameter"><code><a class="link" href="gmime-gmime-charset.html#GMimeCharset" title="struct GMimeCharset"><span class="type">GMimeCharset</span></a> *mask</code></em>,
                           <em class="parameter"><code>const <span class="type">char</span> *charset</code></em>,
                           <em class="parameter"><code>const <span class="type">char</span> *text</code></em>,
                           <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
<p>Check to see if the UTF-8 <em class="parameter"><code>text</code></em>
 will fit safely within <em class="parameter"><code>charset</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-charset-can-encode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-charset.html#GMimeCharset" title="struct GMimeCharset"><span class="type">GMimeCharset</span></a> mask</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>a charset</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>utf-8 text to check</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>text</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-charset-can-encode.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if it is safe to encode <em class="parameter"><code>text</code></em>
into <em class="parameter"><code>charset</code></em>
or <code class="literal">FALSE</code>
otherwise.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gmime-gmime-charset.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GMimeCharset"></a><h3>struct GMimeCharset</h3>
<pre class="programlisting">struct GMimeCharset {
	unsigned int mask;
	unsigned int level;
};
</pre>
<p>State used by <a class="link" href="gmime-gmime-charset.html#g-mime-charset-best" title="g_mime_charset_best ()"><code class="function">g_mime_charset_best()</code></a> and <a class="link" href="gmime-gmime-charset.html#g-mime-charset-best-name" title="g_mime_charset_best_name ()"><code class="function">g_mime_charset_best_name()</code></a>.</p>
<div class="refsect3">
<a name="GMimeCharset.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p>unsigned <span class="type">int</span> <em class="structfield"><code><a name="GMimeCharset.mask"></a>mask</code></em>;</p></td>
<td class="struct_member_description"><p>charset mask</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>unsigned <span class="type">int</span> <em class="structfield"><code><a name="GMimeCharset.level"></a>level</code></em>;</p></td>
<td class="struct_member_description"><p>charset level</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>